<?php
$this->breadcrumbs()->addPage('Consulta', 'consultar');
$this->breadcrumbs()->addPage('Resultados');
echo $this->breadcrumbs()->render();

echo $this->pagenav()->openList();

$html = '<div class="total_documents">Total de itens: <strong>' . $this->totalDocumentos . '</strong></div>';
echo $this->pagenav()->customHelperLinks($html);

echo $this->pagenav()->closeList();
?>

<div id="article">
    <table class="grid">
        <thead>
            <tr>
                <th>Local Atual</th>
                <th>Número</th>
                <th>Envolvido</th>
                <th>Tipo</th>
                <th>Assunto</th>
            </tr>
        </thead>
        <tbody>
            <?php if ($this->processos) : ?>
                <?php foreach ($this->processos as $key => $processo) : ?>
                    <tr class="<?php echo ($key%2==0) ? "even" : "odd"; ?>">
                        <td><strong><?php echo $processo->protocolo->path; ?></strong></td>
                        <td><?php echo str_replace("_", "/", $processo->nome); ?></td>
                        <td><?php echo $processo->manifestante->nome; ?></td>
                        <td><?php echo $processo->tipoProcesso->nome; ?></td>
                        <td><?php echo $processo->assunto->nome; ?></td>
                    </tr>
                <?php endforeach; ?>
            <?php else: ?>
                <tr>
                    <td colspan="8">Nenhum processo encontrado.</td>
                </tr>
            <?php endif ?>
        </tbody>
    </table>
</div>
